import zhCN from "./lang/zh-CN.json";
import pt from "./lang/pt-pt.json";

export type LocaleType = "zh-CN" | "en" | "pt-pt";

// export const LOCALE: { [key: string]: LocaleType } = {
//   ZH_CN: "zh_CN",
//   EN_US: "en",
// };

export function useLocale(langCode='1') {
  const LOCALE: { [key: string]: LocaleType } = {
    1: "pt-pt",
    2: "zh-CN",
  };

  let locale = LOCALE[langCode];
  let messages: any = {
    "zh-CN": zhCN,
    "pt-pt": pt,
  };

  

  return {
    locale,
    t(k: string) {
      return messages[locale][k];
    },
  };
}
